﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Pheonix.CodeLibrary.Web;
using Pheonix.Fashionzoomer.BLL;
using Pheonix.Fashionzoomer.Entity.SqlServer2000;

public partial class page_private_user_MyAccount : PrivateBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Title = SiteName + " - User Account"; 

        edit.ImageUrl = "~/App_Themes/" + Page.StyleSheetTheme + "/image/edit.gif";

        LoadData();
    }

    private void LoadData()
    {
        Pheonix.Fashionzoomer.Entity.SqlServer2000.Profile profile;
        Pheonix.Fashionzoomer.Entity.SqlServer2000.User user;
        UserManager.GetUserAccountInfo(SessionManager.LoggedUser.Id, out user, out profile);

        userFullName.Text = profile.UserFirstName + " " + profile.UserLastName;
        userEmail.Text = user.UserEmail;
        timeZone.Text = ConvertTimeZone(profile.TimeZone);
    }

    protected void Edit_Click(object sender, EventArgs e)
    {

    }

    private string ConvertTimeZone(int timezone)
    {
        if (timezone == 0)
            return "+0.00 GMT";
        else if (timezone > 0)
        {
            return "+" + timezone.ToString().Substring(0, 2) + "." + timezone.ToString().Substring(2, 2);
        }
        else
        {
            return "+" + timezone.ToString().Substring(0, 2) + "." + timezone.ToString().Substring(2, 2);
        }
    }
}
